import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [{
        path: '/',
        name: 'Home',
        component: () =>
            import ('../views/Home/home.vue'),
        meta: {
            showFooter: true
        },
    },
    {
        path: '/search',
        name: 'Search',
        component: () =>
            import ('../views/Search/search.vue'),
        meta: {
            showFooter: true
        }
    },

    {
        path: '/Login',
        name: 'Login',
        component: () =>
            import ('../views/Login/login.vue'),
        meta: {
            showFooter: false
        },
    },
    {
        path: '/register',
        name: 'Register',
        component: () =>
            import ('../views/Register/register.vue'),
        meta: {
            showFooter: false
        },
    },

]

const router = new VueRouter({
    routes
})
const originalPush = VueRouter.prototype.push

VueRouter.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}

export default router